package com.itheima;

import java.util.TreeSet;

/**
 * @auther Macrydy
 * @date 2020/6/30 9:33
 */
public class TreeSetDemo {
    public static void main(String[] args) {
        TreeSet<Student> students = new TreeSet<>();

        Student stu1 = new Student("zhangsan", 25);
        Student stu2 = new Student("lisi", 25);
        Student stu3 = new Student("wangwu", 21);

        students.add(stu1);
        students.add(stu2);
        students.add(stu3);

        System.out.println(students);
    }
}
